<?php
    if (get_template_type() == 'header') {
?>
    <link rel="stylesheet" href="/shop/templates/tp1/css/list.css">

        <div class="ibar" id="iBar" style="z-index: 9990; right: 0px; position: fixed; top: 0px; display: block;">
            <div class="ibar_main_panel" style="left: 0px;">
                <ul class="ibar_mp_center">
                    <?php if ($_SESSION['is_login']) {?>
                        <li class="mpbtn_login"><a href="#"><s></s>登录</a>
                    <?php } else {?>
                        <li class="mpbtn_login"><a href="#"><s></s>登录</a>
                        </li>
                    <?php } ?>
                    <li class="mpbtn_cart" style="left: 0px;"><a href="#" data-plugin="iBarCart"><s></s><span class="text">购物车</span><span class="cart_num">0</span></a>
                    </li>

                    <li class="mpbtn_histroy">
                        <a href="#" data-plugin="iBarHistroy" title="点击查看足迹"><s></s>我看过的</a>
                    </li>

                </ul>
                <?php
                    $er = tpl_get("二维码");
                ?>
                <ul class="ibar_mp_bottom">
                    <li class="mpbtn_qrcode"><a href="#"><s></s></a>
                        <div class="mp_qrcode" style="display: none;z-index:9999999;">
                            <img src="<?php echo $er['pic']?>" width="148" height="175"><s class="icon_arrow_white"></s>
                        </div>
                    </li>
                    <?php $item_setting = tpl_get("基本设置");?>
                    <?php
                        $config = Model('setting')->getListSetting();
                    ?>
                    <li class="mpbtn_support">
                        <a href="<?php echo $config['website_qq'];?>" data-plugin="iBarFaq" title="客服中心" target="_blank"><s></s>客服中心</a>
                    </li>
                    <li class="mpbtn_gotop" id="gotop" style="visibility: visible;"><a href="#" class="btn_gotop"><s></s>返回顶部</a>
                        <div class="mp_tooltip" style="visibility: hidden;">返回顶部<s class="icon_arrow_right_black"></s>
                        </div>
                    </li>
                    <style>
                        .becomebig{
                            transform:scale(1.3);
                            transition:All 0.4s ease-in-out;
                            z-index: 999;
                        }
                    </style>
                    <script>
                        $(function(){
                            $('.mpbtn_qrcode').hover(function(){
                                $('.mp_qrcode').show();
                            },function(){
                                $('.mp_qrcode').hide();
                            })

                            $('.mpbtn_histroy,.mpbtn_cart').click(function(){
                                $('#iBarHistroy,#iBarCart').hide();
                                $('#iBar').find('.current').removeClass('current');
                                if($(this).hasClass('mpbtn_histroy')){
                                    $('#iBarHistroy').show();
                                }
                                else{
                                    $('#iBarCart').show();
                                }
                                if($('.ibar_sub_panel').css('display') == 'none'){
                                    $(this).find('a:first').addClass('current');
                                    $('.ibar_sub_panel').css({left:0}).show().animate({
                                        left : -287
                                    });
                                }

                                return false;

                            });

                            $(document).on('click','.ibar_closebtn',function(){
                                $('#iBar').find('.current').removeClass('current');
                                if($(this).parent().hasClass('ibar_login_box')){
                                    $('.ibar_login_box').hide();
                                }
                                else{
                                    $('.ibar_sub_panel').animate({
                                        left : 0
                                    },function(){
                                        $('.ibar_sub_panel').hide();
                                    })
                                }


                            });

                            var login_timer = null;
                            $('.mpbtn_login').hover(function(event) {
                                var _this = $(this);
                                login_timer = setTimeout(function(){
                                    $('.ibar_login_box').css({
                                        top : _this.offset().top
                                    }).show();
                                },250)

                            },function(){
                                login_timer = setTimeout(function(){
                                    $('.ibar_login_box').hide();
                                },250);
                            });

                            $('.ibar_login_box').hover(function(){
                                clearTimeout(login_timer);
                            },function(){
                                login_timer = setTimeout(function(){
                                    $('.ibar_login_box').hide();
                                },250);
                            });

                            $('.mpbtn_gotop,.mpbtn_histroy,.mpbtn_support').hover(function(){
                                $(this).find('.mp_tooltip').css('visibility','visible');
                            },function(){
                                $(this).find('.mp_tooltip').css('visibility','hidden');
                            });


                            function getRect( elements ){
                                var rect = elements.getBoundingClientRect();
                                var clientTop = document.documentElement.clientTop;
                                var clientLeft = document.documentElement.clientLeft;
                                return { // 兼容ie多出的两个px
                                    top : rect.top - clientTop, // 距离顶部的位置
                                    bottom : rect.bottom - clientTop, // 距离顶部加上元素本身的高度就等于bottom的位置
                                    left : rect.left - clientLeft, // 距离左边的位置
                                    right : rect.right - clientLeft // 距离右边的位置就是 距离左边的位置加上元素本身的宽度
                                };
                            };
                            window.add_to_cart_animate = function(obj,src,callback){
                                var pos = getRect(obj);
                                var target_pos =  getRect($('.mpbtn_cart s:first')[0]);

                                var img = $('<img>').attr({
                                    'src' : src
                                }).css({
                                    position : 'fixed',
                                    top : pos.top,
                                    left : pos.left + 25,
                                    border : '2px solid #fb2f72',
                                    borderRadius : '35px',
                                    width : 35,
                                    height : 35,
                                    zIndex : 998,
                                    background : '#fff'
                                }).appendTo('body');
                                img.animate({
                                    top : '-=50px'
                                },'fast',function(){
                                    img.animate({
                                        top : target_pos.top - 100,
                                        left : target_pos.left - 50
                                    },function(){
                                        img.animate({
                                            left : '+=50',
                                            top : target_pos.top - 15,
                                            width : 15,
                                            height : 15,
                                            borderRadius : '15px',
                                        },'fast');
                                        $('.mpbtn_cart s').addClass('becomebig');
                                        setTimeout(function(){
                                            $('.mpbtn_cart s').removeClass('becomebig');
                                            img.remove();
                                            $('<i>').css({
                                                width : '15px',
                                                height : '15px',
                                                borderRadius : '15px',
                                                position : 'fixed',
                                                zIndex : '1000',
                                                left : target_pos.left + 5,
                                                top : target_pos.top - 10,
                                                background : '#fb2f72',
                                                color : '#fff',
                                                'line-height' : '12px',
                                                'text-align' : 'center'
                                            }).html(1).appendTo('body').animate({
                                                'top' : '-=10'
                                            }).fadeOut();
                                            load_side_cart();
                                            load_cart_index();
                                        },400);
                                    })
                                });
                            }

                            $(document).on('click','.imp-addCart',function(event) {
                                // console.log(pos);
                                var src = $(this).closest('.imp_item').find('.pic img').attr('src');
                                add_to_cart_animate(this,src)
                                addcart($(this).attr('key'),1)
                            });
                        })
                    </script>
                </ul>
            </div>
            <style>
                ._jmyp .ibar_cart_handler{
                    position: relative !important;
                    top: 0 !important;
                    text-align: center;
                }
            </style>
            <div class="ibar_login_box  status_logout" style="top: 97px; display: none;">
                <?php if(!$_SESSION['member_id']){?>
                    <div class="avatar_box">
                        <p class="avatar_imgbox"> </p>
                        <p>你好！请&nbsp;<a href="/shop/index.php?act=login">登录</a>&nbsp;|&nbsp;<a href="/shop/index.php?act=login&op=register">注册</a>
                        </p>
                    </div>
                <?php }else{?>
                    <div class="avatar_box"><p class="avatar_imgbox"><img src="/data/upload/shop/avatar/avatar_<?php echo $_SESSION['member_id']?>.jpg" alt="头像" width="62" height="62"></p><ul class="user_info"><li style='text-align:center'>用户名：<?php echo $_SESSION['member_name']?></li><li></li></ul>
                    </div>
                    <div class="login_btnbox"><a href="/shop/index.php?act=member_order" class="login_order" target="_blank">我的订单</a><a href="/shop/index.php?act=member_favorites&op=fglist" class="login_favorite" target="_blank">我的收藏</a>
                    </div><s class="icon_arrow_white"></s>
                <?php }?>
                <a href="javascript:;" class="ibar_closebtn" title="关闭"></a>
            </div>
            <div class="ibar_sub_panel">
                <a href="javascript:;" class="ibar_closebtn" title="关闭"></a><span class="ibar_loading_text">正在为您努力加载数据！</span>
                <div class="ibar-moudle-wrap ibar_plugin" id="iBarHistroy" style="display: block;">
                </div>
                <script>
                    $('#iBarHistroy').load('/shop/templates/tp1/tp1.foot.php');
                </script>
                <div class="ibar_plugin ibar_cart_content" id="iBarCart">
                </div>
                <script>
                    function load_side_cart(){
                        $('#iBarCart').load('/shop/templates/tp1/tp1.cart.php',function(){
                            $('.cart_num').html($('.ibar_cart_total_quantity').html())
                        });
                    }
                    load_side_cart();
                </script>
            </div>
        </div>

    <section class="top">
        <div class="wrapper">
            <div class="menu">
                <?php
                if (isset($_SESSION['member_id'])) {
                    ?>
                    <div class="member_center">
                        <a href="javascript:;" class="lm">
                            <?php
                                echo $_SESSION['member_name'];
                            ?>
                            <span class="icon icon-angle-down"></span>
                        </a>

                        <div class="others">
                            <a href="/shop/index.php?act=member&op=home">个人中心</a>
                            <a href="/shop/index.php?act=member_order">我的订单</a>
                            <a href="javascript:;" id="logout">退出登录</a>
                        </div>
                        <script>
                            $('#logout').click(function () {
                                $.get('/shop/?act=login&op=logout', function (msg) {
                                    location.reload();

                                }, 'json');
                            });
                        </script>
                    </div>
                <?php
                    } else {
                ?>
                    <a href="/shop/?act=login" class="top-login">请登录</a>　|
                    <a href="/shop/?act=login&op=register" class="top-reg">注册</a>
                <?php
                    }
                ?>
            </div>

            <div class="link top_link">
                <span class="shop-manager">
                    商家管理
                    <ul>
                        <li>
                            <a href="/shop/index.php?act=show_joinin&op=index">商家申请</a>
                        </li>
                        <li>
                            <a href="/shop/index.php?act=seller_center">商家登录</a>
                        </li>
                    </ul>
                </span>
                <code>|</code>
                <span href="javascript:;" class="gz">关注我们
                    <div >
                        <?php $er = tpl_get("二维码"); ?>
                        <img class="top_qr" src="<?php echo $er['pic']?>">
                    </div>
                </span>
                <code>|</code>
                <span href="/shop/index.php?act=member_favorites&op=fglist" style="">收藏夹</span>
                <code>|</code>
                <span href="javascript:;">最近浏览
                    <div id="recent_view">
                        <table>
                            <?php
                            $recent = cookie('recent_goods') or $recent = '[]';
                            $recent = json_decode($recent, true);
                            $goods = Model()->table('goods')->where(array('goods_id' => array('in', $recent)))->select();
                            foreach ($goods as $k => $g) {
                                ?>
                                <tr
                                    <?php
                                    if ($k == count($goods) - 1) {
                                        echo 'style="border-bottom : 0"';
                                    }
                                    ?>
                                >
                                    <td>
                                        <img src="<?php echo thumb($g, 50, 1) ?>" style="width: 50px;height: 50px;">
                                    </td>
                                    <td>
                                        <p style="line-height: 18px;font-size: 13px;color: #f60;">
                                            <a href="/shop/?act=goods&goods_id=<?php echo $g['goods_id']?>" target="_blank" style="color: inherit;font-size: inherit;">
                                                <?php echo $g['goods_name'] ?>
                                            </a>
                                        </p>

                                        <p style="line-height: 18px;font-size: 13px;"><?php echo $g['goods_jingle'] ?>
                                            &nbsp;</p>
                                    </td>
                                    <td>
                                        <small style="line-height: 18px;display: inline-block;vertical-align: top;">
                                            <?php echo $g['goods_price'] ?>元
                                        </small>
                                    </td>
                                    <td>
                                        <a data-id=<?php echo $g['goods_id'] ?> href="javascript:;" class="_remove" style="line-height: 18px;display: inline-block;vertical-align: top;">
                                            x
                                        </a>
                                    </td>
                                </tr>

                                <?php
                            }
                            ?>
                        </table>
                        <div>
                            <a href="/shop/?act=cart" class='cart'>
                                <b class="icon icon-plus">
                                </b>
                                购物袋
                            </a>
                            <a href="javascript:;" class="remove_all" style="color: #666;font-size: 12px;float: right;">全部删除</a>
                        </div>
                    </div>
                </span>
                <script>
                    $('.top_link .remove_all').click(function () {
                        $.get('/shop/?act=seccode&op=remove_recent', function () {
                            $('.top_link tr').fadeOut();
                        })
                    });

                    $('.top_link ._remove').click(function () {
                        var id = $(this).attr('data-id');
                        var _this = $(this);
                        $.get('/shop/?act=seccode&op=remove_recent', {id: id}, function () {
                            _this.closest('tr').fadeOut();
                        });
                    })
                </script>
                <code>|</code>
                <?php $item = tpl_get("基本设置");?>
                <span href="/shop/index.php?act=article&op=article&ac_id=35">帮助中心</span>

            </div>
            <script>
                $('.top_link span').click(function () {
                    var href = null;
                    if((href = $(this).attr('href')) != ''){
                        if($(this).attr('target')  == '_blank'){
                            window.open(href);
                        }
                        else{
                            location.href = href;
                        }
                    }

                    if ($(this).hasClass('_wait')) {
                        layer.msg("等待集成客服插件");
                    }
                })
            </script>


        </div>
    </section>
    <style>
        :-ms-input-placeholder{
            line-height : 20px !important;
        }
    </style>
    <section class="logon">
        <div class="wrapper">
            <div class="logon">
                <?php
                    $img = tpl_get("logo");
                ?>
                <a href="/">
                    <img src="<?php echo $img['pic'] ?>" alt="" style="width: 160px;height: 124px;float: left;">
                </a>
            </div>

            <div class="slogan">

            </div>

            <section class="search">
                <input type="text" class='keyword' placeholder="<?php $base = tpl_get("基本设置");echo $base[0]['search']?>">
                <span class="icon icon-search" style="cursor: pointer;"></span>
            </section>
            <script>
                $('.keyword').keyup(function (e) {
                    if (e.keyCode == 13) {
                        $('section.search span.icon-search').trigger('click');
                    }
                });

                $('section.search span.icon-search').click(function () {
                    if ($.trim($('.keyword').val()) == '') {
                        layer.msg("请输入要搜索的内容");
                        return;
                    }
                    var url = "/shop/?act=search&keyword=" + $('.keyword').val();
                    location.href = url;
                })
            </script>

        </div>

    </section>

    <style>
/*        #_nav { */<?php //$base = tpl_get("基本设置"); ?>/* background: url(*/<?php //echo $base[1]['nav']['pic']?>/*) repeat-x !important; background-size: contain; }*/
    </style>
    <nav id="_nav">
        <div class="wrapper" style="position: relative;height: 100%;">
            <ul class="navigation">
                <h3 class="nav-item-title">
                    分类导航
                </h3>

                <div class="category-list">
                <?php
                $all_cats = Model('goods_class')->getGoodsClassListByParentId(0);
                foreach ($all_cats as $item) {
                    ?>
                    <li class="nav-item" style="background-image:url(/data/upload/shop/common/category-pic-<?php echo $item['gc_id'] ?>.jpg)">
                        <?php echo str_replace("/","<br>",$item['gc_name']); ?>
                        <ul class="navigation-son">
                            <li class="nav-son-title" onclick="location.href='/shop/?act=search&cate_id=<?php echo $item['gc_id'] ?>'" style="cursor: pointer;">
                                <?php echo $item['gc_name']; ?>
                            </li>
                            <?php
                            $cat2 = Model('goods_class')->getGoodsClassListByParentId($item['gc_id']);
                            foreach ($cat2 as $i) {
                                ?>
                                <li class="nav-son-item">
                                    <a href="/shop/?act=search&cate_id=<?php echo $i['gc_id'] ?>" class="nm"><?php echo $i['gc_name'] ?>：</a>

                                    <div class="_child">
                                        <?php
                                            $cat3 = Model('goods_class')->getGoodsClassListByParentId($i['gc_id']);
                                            foreach ($cat3 as $_cat) {
                                        ?>
                                            <a href="/shop/?act=search&cate_id=<?php echo $_cat['gc_id'] ?>"><?php echo $_cat['gc_name'] ?></a>
                                        <?php
                                            }
                                        ?>
                                    </div>
                                </li>
                            <?php
                                }
                            ?>
                        </ul>
                    </li>
                    <?php
                }
                ?>
                </div>
            </ul>
            <a class="nav-fill">&nbsp;</a>
            <?php
                $nav = get_nav();
                foreach ($nav as $link) {
                    if (is_array($link)) {
                        foreach ($link as $l) {
                            echo "<a href='$l[nav_url]'>$l[nav_title]</a>";
                        }
                    } else {
                        echo "<a href='/'>$link</a>";
                    }
                }
            ?>
        </div>
        <script>
            $(".navigation").hover(function () {
                $(".category-list").css({ 'display': 'block' });
            }, function () {
                $(".category-list").css({ 'display': 'none' });
            });
        </script>
    </nav>
    <?php
}
?>

<?php
if (get_template_type() == 'index') {
    ?>
    <link rel="stylesheet" href="/shop/templates/haidao/js/unslider/css/unslider.css">

    <script src="/data/resource/js/jquery.js"></script>
    <script src="/shop/templates/haidao/js/unslider/js/unslider-min.js"></script>
    <script>
        $(function () {
            $('.automatic-slider').unslider({
                autoplay: true, arrows: false, dots: true, delay:4500})
        })
    </script>

    <section class="middle">
            <div class="automatic-slider" >
                <ul>
                    <?php
                        $imgs = tpl_get("首页轮播");
                        foreach ($imgs as $img) {
                    ?>
                        <li>
                            <a href="<?php echo $img['link'];?>" target="_blank" style="float: left;width: 100%;height: 461px;background:url('<?php echo $img['pic'];?>') center center">
                            </a>
                        </li>
                    <?php
                        }
                    ?>
                </ul>
            </div>
    </section>

    <section class="ads">
        <div class="wrapper">
            <?php
            $imgs = tpl_get(("中部广告位"));
            ?>
            <a href="<?php echo $imgs[0]['link'] ?>">
                <img src="<?php echo $imgs[0]['pic'] ?>" alt="">
            </a>
            <a href="<?php echo $imgs[1]['link'] ?>">
                <img src="<?php echo $imgs[1]['pic'] ?>" alt="">
            </a>
            <a href="<?php echo $imgs[2]['link'] ?>" style="margin-right: 0;">
                <img src="<?php echo $imgs[2]['pic'] ?>" alt="">
            </a>
        </div>
    </section>

    <section class="floor">
            <?php
                $floors = tpl_get("楼层");
                foreach ($floors as $kkk=> $floor) {
             ?>
                <div class="<?php if(in_array($floor['style'],array(5))){
                    $floor_type2 = true;$floor_type1=false; echo 'floor-inner-type2';
                } else{ $floor_type1 = true; $floor_type2=false;echo 'floor-inner-type1';}?>">
                    <!--是否显示头部-->
                    <?php if( $floor_type1){ ?>
                     <?php if(in_array($floor['style'],array(6,7))){?>
                            <div class="head_style2"><?php echo $floor['floor_name']; ?></div>
                    <?php }else{ ?>
                            <div class="head">
                            <span class="floor_name">
                                <?php echo $floor['floor_name']; ?>
                            </span>

                                <div class="short_link">
                                    <?php
                                    $arr = explode(',', $floor['short_link']);
                                    foreach ($arr as $key => $item) {
                                        ?>
                                        <a href="/shop/?act=search&keyword=<?php echo $item; ?>"><?php echo $item; ?></a>
                                        <?php
                                    }
                                    ?>
                                </div>
                            </div>
                    <?php } ?>
                    <?php } ?>
                    <div class="body">
                        <?php
                        if ($floor['style'] == 1) {
                            $arr = array('g1', 'g2', 'g3', 'g4');
                            $condition = array();
                            foreach ($arr as $item) {
                                if (!empty($item)) {
                                    $condition[] = $floor[$item];
                                }
                            }
                            $gmlist = Model()->table('goods_common')->where(array('goods_commonid' => array('in', $condition)))->select();

                            foreach ($gmlist as $gminfo) {
                                $ginfo = Model()->table('goods')->where(array('goods_commonid' => $gminfo['goods_commonid']))->find();


                                ?>
                                <div class="item">
                                    <a href="<?php echo urlShop('goods', 'index', array('goods_id' => $ginfo['goods_id'])); ?>"
                                       class="img">
                                        <img src="<?php echo thumb($ginfo, 240, 1) ?>" alt="">
                                    </a>

                                    <div class="name">
                                        <p>
                                            <b><?php echo $ginfo['goods_name'] ?></b>
                                        </p>

                                        <p>
                                            <span> <?php
                                                echo $ginfo['goods_jingle'];
                                            ?> </span>
                                        </p>

                                    </div>
                                    <div class="price">
                                        ￥
                                        <?php
                                            echo $ginfo['goods_price'];
                                        ?>
                                    </div>
                                </div>
                                <?php
                            }
                        } else if ($floor['style'] == 2) {
                            ?>
                            <div>
                                <a style="float: left;" href="<?php echo $floor['img1']['link'] ?>">
                                    <img style="width: 600px;height: 230px;" src="<?php echo $floor['img1']['pic'] ?>"
                                         alt="">
                                </a>
                                <a style="float: left;" href="<?php echo $floor['img2']['link'] ?>">
                                    <img style="width: 600px;height: 230px;" src="<?php echo $floor['img2']['pic'] ?>"
                                         alt="">
                                </a>
                            </div>
                            <div>
                                <a style="float: left;" href="<?php echo $floor['img3']['link'] ?>">
                                    <img style="width: 400px;height: 230px;" src="<?php echo $floor['img3']['pic'] ?>"
                                         alt="">
                                </a>
                                <a style="float: left;" href="<?php echo $floor['img4']['link'] ?>">
                                    <img style="width: 400px;height: 230px;" src="<?php echo $floor['img4']['pic'] ?>"
                                         alt="">
                                </a>
                                <a style="float: left;" href="<?php echo $floor['img5']['link'] ?>">
                                    <img style="width: 400px;height: 230px;" src="<?php echo $floor['img5']['pic'] ?>"
                                         alt="">
                                </a>
                            </div>

                            <?php
                        } else if ($floor['style'] == 3) {
                            ?>
                            <div class="type3-left">
                                <div class="type3_style1">
                                    <a href="<?php echo $floor['img1']['link'] ?>">
                                        <img src="<?php echo $floor['img1']['pic']?>">
                                    </a>
                                </div>
                                <a class="type3_style5" href="<?php echo $floor['img2']['link']?>" >
                                    <div class="goods_pic">
                                        <img src="<?php echo $floor['img2']['pic'] ?>">
                                    </div>
                                    <div class="name">
                                        <?php echo $floor['img2']['goods_name'] ?>
                                    </div>
                                    <div class="goods_price">
                                        <span>￥</span><?php echo $floor['img2']['price'] ?>
                                        <img src="/shop/templates/tp1/images/gotosee.png" alt="">
                                    </div>
                                </a>
                            </div>

                            <div class="type3-mid">
                                <?php $mid3_arr = array(3,4,5,8,9,10);?>
                                <?php foreach($mid3_arr as $v){ ?>
                                    <a class="type3_style2" href="<?php echo $floor['img'.$v]['link']?>" >
                                        <div class="goods_pic"><img src="<?php echo $floor['img'.$v]['pic'] ?>"></div>

                                        <div class="name">
                                            <?php echo $floor['img'.$v]['goods_name'] ?>
                                        </div>
                                        <div class="goods_price">
                                            <span>￥</span><?php echo $floor['img'.$v]['price'] ?>
                                        </div>
                                    </a>
                                <?php } ?>
                            </div>

                            <div class="type3-right">
                                <?php $right3_arr = array(6,7,11);?>
                                <?php foreach($right3_arr as $v){ ?>
                                    <a class="type3_style3" href="<?php echo $floor['img'.$v]['link']?>" >
                                        <div class="goods_pic">
                                            <img src="<?php echo $floor['img'.$v]['pic'] ?>">
                                        </div>
                                        <div class="name">
                                            <?php echo $floor['img'.$v]['goods_name'] ?>
                                        </div>
                                        <div class="goods_price">
                                            <span>￥</span><?php echo $floor['img'.$v]['price'] ?>
                                            <img src="/shop/templates/tp1/images/gotosee.png" alt="">
                                        </div>
                                    </a>
                                <?php } ?>
                                <a class="type3_style4" href="<?php echo $floor['img12']['link']?>" >
                                    <img class="goods_pic" src="<?php echo $floor['img12']['pic'] ?>">
                                </a>
                            </div>

                        <?php
                            } else if ($floor['style'] == 4) {
                            foreach($floor['goods'] as $v){
                        ?>
                                <div class="item type4_style1">
                                    <a href="<?php echo $v['link'] ?>" class="img">
                                        <img src="<?php echo $v['pic'] ?>" alt="">
                                    </a>

                                    <div class="name">
                                        <p>
                                            <b><?php echo $v['goods_name'] ?></b>
                                        </p>
                                    </div>

                                    <div class="price"> ￥<?php echo $v['price'] ?> </div>
                                </div>
                        <?php
                                }
                            }else if( $floor['style'] == 5){
                        ?>
                            <a class="type5_style1" href="<?php echo $floor['img']['link'];?>" style="background: url('<?php echo $floor['img']['pic']?>') center no-repeat;">
                                <img src="<?php echo $floor['img']['pic']?>" style="opacity: 0;">
                            </a>

                        <?php }else if($floor['style'] == 6){ ?>
                            <div class="type6-left">
                                <a class="type6_style1" href="<?php echo $floor['img1']['link']?>" >
                                    <img src="<?php echo $floor['img1']['pic'] ?>">
                                </a>
                            </div>
                            <div class="type6-right">
                                <?php $right6_arr = array(2,4,6,3,5,7);?>
                                <?php foreach($right6_arr as $v){ ?>
                                    <a class="type6_style2" href="<?php echo $floor['img'.$v]['link']?>" >
                                        <div class="goods_pic">
                                            <img src="<?php echo $floor['img'.$v]['pic'] ?>">
                                        </div>
                                        <div class="name">
                                            <?php echo $floor['img'.$v]['goods_name'] ?>
                                        </div>
                                        <div class="goods_price">
                                            <span>￥</span><?php echo $floor['img'.$v]['price'] ?>
                                        </div>
                                        <img class="hot-icon" src="/shop/templates/tp1/images/hot.png" alt="">
                                    </a>
                                <?php } ?>
                            </div>
                        <?php }else if($floor['style'] == 7){ ?>
                            <div class="type7-left">
                                <?php $left7_arr = array(1,3,2,4);?>
                                <?php foreach($left7_arr as $v){ ?>
                                    <a class="type7_style1" href="<?php echo $floor['img'.$v]['link']?>" >
                                        <div class="goods_pic">
                                            <img src="<?php echo $floor['img'.$v]['pic'] ?>">
                                        </div>
                                        <div class="goods_name">
                                            <?php echo $floor['img'.$v]['goods_name'] ?>
                                        </div>
                                        <div class="goods_price">
                                            <span>￥</span><?php echo $floor['img'.$v]['price'] ?>
                                        </div>
                                    </a>
                                <?php } ?>
                            </div>
                            <div class="type7-right">
                                <?php $right7_arr = array(5,6,7);?>
                                <?php foreach($right7_arr as $v){ ?>
                                    <a class="type7_style2" href="<?php echo $floor['img'.$v]['link']?>" >
                                        <div class="goods_pic">
                                            <img src="<?php echo $floor['img'.$v]['pic'] ?>">
                                        </div>
                                        <div class="goods_name">
                                            <?php echo $floor['img'.$v]['goods_name'] ?>
                                        </div>
                                        <div class="goods_price">
                                            <span>￥</span><?php echo $floor['img'.$v]['price'] ?>
                                            <img class="hot-icon" src="/shop/templates/tp1/images/gotosee.png" alt="">
                                        </div>

                                    </a>
                                <?php } ?>
                            </div>
                        <?php }else if($floor['style'] == 8) { ?>
                            <div class="type8-left">
                                <div class="switch-box">
                                   <div class="box-inner box-inner-<?php echo $kkk;?>">
                                       <?php foreach ($floor['imgs1'] as $k => $v){?>
                                           <a class="type8_style1" href="<?php echo $v['link']?>">
                                               <img src="<?php echo $v['pic']?>" alt="">
                                           </a>
                                       <?php } ?>
                                   </div>
                                </div>
                                <div class="switch-nav">
                                <?php foreach ($floor['imgs1'] as  $v){ ?>
                                    <a href="javascript:" class="<?php if($v['show'] =='1'){echo 'active';}?>">&nbsp;</a>
                                <?php } ?>
                                </div>
                            </div>
                            <script>
                            $(".switch-nav").on("click","a",function(){
                                $(this).parents(".switch-nav").siblings(".switch-box").find("a").hide();
                                    $(this).parents(".switch-nav").siblings(".switch-box").find("a").eq($(this).index()).fadeIn();
                                    $(this).siblings("a").removeClass("active");
                                    $(this).parents(".switch-nav").find("a").eq($(this).index()).addClass("active");
                            })
                               
                                marquee(4500,'.box-inner-<?php echo $kkk;?>');
                                function marquee(time,id){
                                    $(function(){
                                        var _wrap=$(id);
                                        var _interval = time;
                                        var _moving;
                                        _wrap.parent(".switch-box").siblings(".switch-nav").hover(function(){
                                            clearInterval(_moving);
                                        });

                                        _wrap.hover(function(){
                                            clearInterval(_moving);
                                        },function(){
                                            _wrap.find('a').show();
                                            _moving=setInterval(function(){
                                                var _field=_wrap.find('a:first');
                                                var _field1 = _field.clone();
                                                _field.remove();
                                                _wrap.append(_field1);
                                                var aa   =  _wrap.parent(".switch-box").siblings(".switch-nav").find("a").eq(0);
                                                var _aa  = aa.clone();
                                                aa.remove();
                                                _wrap.parent(".switch-box").siblings(".switch-nav").append(_aa);
                                            },_interval);
                                        }).trigger('mouseleave');


                                    });
                                }
                            </script>
                            <div class="type8-right">
                                <?php for($i=1;$i<9;$i++){ ?>
                                    <a class="type8_style2" href="<?php echo $floor['img'.$i]['link']?>" >
                                        <div class="goods_pic">
                                            <img src="<?php echo $floor['img'.$i]['pic'] ?>">
                                        </div>
                                        <div class="goods_name">
                                            <?php echo $floor['img'.$i]['goods_name'] ?>
                                        </div>
                                    </a>
                                <?php } ?>
                            </div>
                        <?php } else if($floor['style'] == 9){ ?>
                            <div class="new_goods_floor">
                                <img src="/shop/templates/template1/Images/loading.gif" alt="">
                            </div>
                            <script>
                                $.ajax({
                                    url:"/shop/?act=new_goods&op=floor_new",
                                    success:function(data){
                                        var html = '';
                                        data = JSON.parse(data);
                                        $.each(data,function(index,val){
                                            var item_html = "<div class='item type4_style1'>"
                                                + "<a href='"+val.link+"' class='img'>"
                                                + "<img src='"+val.pic+"' />"
                                                + "</a>"
                                                + "<div class='name'>"
                                                + "<p>"
                                                + "<b>"+val.goods_name+"</b>"
                                                + "</p>"
                                                + "</div>"
                                                + "<div class='price'>￥"+val.price+"</div>"
                                                + "</div>";
                                            html += item_html;
                                        });
                                        $(".new_goods_floor").html(html);
                                    }
                                })
                            </script>

                        <?php } ?>
                    </div>
                </div>
                <?php
            }
            ?>
    </section>
<?php
    }
?>

